<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>求职招聘网站管理系统</title>
<script type="text/javascript" src="../jquery/jquery-3.5.1.js"></script>
<link href="../bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css"> 
<script src="../bootstrap-3.3.7-dist/js/bootstrap.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
<div class="row">
  <div class="col-xs-12 col-md-8 col-md-offset-1">
  <div class="col-md-1">
  </div>
   <h1 >求职招聘网站管理系统</h1>
   </div>
    
  <div class="col-xs-6 col-md-4 col-md-offset-10"> 
  <div class="col-md-2">
    <form action="/logout"  method="get" id="log">
   <input value="退出" class="btn btn-default"  type="submit" >
 </form>
    </div>
  </div>
</div>
</nav>

<div class="row">
  <div class="col-md-2">
   <div style="display:none">
   <h5 sec:authentication="principal.uid" id="id" name="id"></h5>
   </div> 
   <button id="illeageuserbtn" class="btn btn-primary btn-lg btn-block">违规用户</button>
   <button id="MyResumeBtn" class="btn btn-primary btn-lg btn-block">违规简历</button>
     
  </div>
  <div class="col-md-8"   >
   <!-- 粘贴违规用户信息 -->
  <table  class="table table-hover"  id="userinfobtn" style="display:none">
   <thead class="thead-dark">
  <tr>
  <td >用户id</td>
  <td>用户名</td>
  <td>违规次数</td>
  <td>注册电话</td>
  <td>封禁状态</td>
  <td>待操作</td>
  </tr>
   </thead>
  <tbody id="illeage_tbody">
   
  <!-- 粘贴违规用户分页信息 -->
 
  </tbody>
</table>
 <!-- 粘贴违规招聘信息 -->
  <table  class="table table-hover"  id="recruitmentinfobtn" style="display:none">
  <tr>
  <td>职位性质</td>
  <td>招聘</td>
  <td>违规次数</td>
  <td>发布时间</td>
  <td>公司</td>
  <td>待操作</td>
  </tr>
  <tbody id="illeagerecruitment_tbody">
   
  <!-- 粘贴分页信息 -->
 
  </tbody>
  
</table>
 <div class="col-md-4 col-md-offset-4" id="illeage_info">
 <!-- 粘贴分页标签向导 -->
</div>
  </div>
  <div class="col-md-2"></div>
</div>

<!-- 模态框,显示详细招聘信息 -->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4  id="zpzt"class="modal-title"></h4>
      </div>
      <div id="onerec" class="modal-body">
        <!-- <p>One fine body&hellip;</p> -->
        <!-- 此处放消息体 -->
      </div>
      <div class="modal-footer">
      
        <button id="gbbtn" type="button" class="btn btn-primary">关闭</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script type="text/javascript">
$("#illeageuserbtn").click(function(){
	$("#userinfobtn").show();
	$("#recruitmentinfobtn").hide();
	$.ajax({
		url:"/admin/selectAllIlleageUser",
		type:"POST",
		data:{},
		ansyc:false,
		success:function(result){
			pasteIlleageUserInfo(result);
		}
	});
})

function pasteIlleageUserInfo(result){
	$("#illeage_tbody").empty();
	var sss=result.extend.illeageuserinfos;
	$.each(sss,function(index,items){
		//列表第一列
		var uid=$("<span></span>").append(items.uid);
		var td1=$("<td></td>").append(uid);
		
		var uname=$("<span></span>").append(items.uname);
		var td2=$("<td></td>").append(uname);
		
		var fcount=$("<span></span>").append(items.fcount).addClass("label label-warning");
		var td3=$("<td></td>").append(fcount);
		
		var utel=$("<span></span>").append(items.utel);
		var td4=$("<td></td>").append(utel);
		
		var ulocked1=$("<span></span>").append(items.ulocked+".");
		var td5=$("<td></td>").append(ulocked1);
		
		var bannedbtn=$("<button></button>").append("封禁").addClass("btn btn-danger btn-sm");
		var fuid=items.uid;
		bannedbtn.click(function(){
			banner(fuid);

			});

		var td6=$("<td></td>").append(bannedbtn);
		
		$("<tr></tr>")
		.append(td1)
		.append(td2)
		.append(td3)
		.append(td4)
		.append(td5)
		.append(td6)
		.appendTo("#illeage_tbody");
		
})
}


//封号
function banner(uid){
	$.ajax({
		url:"/admin/bannedUser",
		type:"POST",
		data:{uid:uid},
		ansyc:false,
		success:function(result){
			alert(result.msg);
		}
	});
	
}

$("#MyResumeBtn").click(function(){

	$("#recruitmentinfobtn").show();
	$("#userinfobtn").hide();
	$.ajax({
		url:"/admin/selectAllIlleageRecuitment",
		type:"POST",
		data:{},
		ansyc:false,
		success:function(result){
			pasteIlleageRecruitmentInfo(result);
		}
	});
	
})
//粘贴违规招聘信息
function pasteIlleageRecruitmentInfo(result){
	$("#illeagerecruitment_tbody").empty();
	var sss=result.extend.illeageRecuitment;
	$.each(sss,function(index,items){
		//列表第一列
		var zhiweiname=$("<span></span>").append(items.jobxingzhi.zhiweiname);
		var td1=$("<td></td>").append(zhiweiname);
		
		var zpname=$("<span></span>").append(items.zpname);
		var td2=$("<td></td>").append(zpname);
		
		var fzcount=$("<span></span>").append(items.fzcount).addClass("label label-warning");
		var td3=$("<td></td>").append(fzcount);
		
		var time=$("<span></span>").append(items.time).addClass("label label-info");
		var td4=$("<td></td>").append(time);
		
		var time=$("<span></span>").append(items.companyInfo.company);
		var td5=$("<td></td>").append(time);
		
		var bannedbtn=$("<button></button>").append("删除").addClass("btn btn-danger btn-sm");
		var zpid=items.zpid;
		bannedbtn.click(function(){
			deleteRecruitment(zpid);
			});

		var detialbtn=$("<button></button>").append("详情").addClass("btn btn-info btn-sm");
		detialbtn.click(function(){
			pasteOneRecinfo(items);
		});
		var td6=$("<td></td>").append(bannedbtn).append(" ").append(detialbtn);
		
		$("<tr></tr>")
		.append(td1)
		.append(td2)
		.append(td3)
		.append(td4)
		.append(td5)
		.append(td6)
		.appendTo("#illeagerecruitment_tbody");
		
})
}

function deleteRecruitment(zpid){
	$.ajax({
		url:"/admin/deleteRecruitmentByPrimaryKey",
		type:"POST",
		data:{zpid:zpid},
		ansyc:false,
		success:function(result){
			alert(result.msg);
		}
		
	});
}
//查看违规招聘的详细信息
//粘贴单个项显示详细招聘信息
function pasteOneRecinfo(items){
	$("#onerec").empty();
	$("#myModal").modal({
		backdrop:"static"
	});
	//招聘主题
	var OneRec=items;
	$("#zpzt").empty();
	$("#zpzt").append(OneRec.zpname);
	//招聘类别
	var zwxz=$("<span></span>").append(OneRec.jobxingzhi.zhiweiname).addClass("label label-info");
	var zw=$("<dt></dt>").append(zwxz);
	//招聘者
	var com=$("<span></span>").append(OneRec.companyInfo.company);
	var index=$("<span></span>").append(".");
	var identity=$("<span></span>").append(OneRec.companyInfo.identity);
	var zhaoinzhe=$("<dt></dt>").append(com).append(index).append(identity);
	//薪资
	var salary=$("<span></span>").append("薪资:  ");
	var sal=$("<dt></dt>").append(salary).append(OneRec.salary);
	//学历
	var xueli=$("<span></span>").append("学历:  ");
	var xul=$("<dt></dt>").append(xueli).append(OneRec.xueli);
	//经验
	var jinyang=$("<span></span>").append("经验:  ");
	var jyg=$("<dt></dt>").append(jinyang).append(OneRec.jinyang);
	//职位详情
	var zwxq=$("<span></span>").append("职位详情").addClass("label label-info");
	var zwx=$("<dt></dt>").append(zwxq);
	//岗位职责
	var gwzz=$("<span></span>").append("岗位职责");
	var gwy=$("<dt></dt>").append(gwzz);
	var gongzuozhize=$("<dt></dt>").append(OneRec.gongzuozhize);
	//岗位要求
	var gwyq=$("<span></span>").append("岗位要求");
	var gzyq=$("<dt></dt>").append(gwyq);
	var gongzuoyaoqiu=$("<dt></dt>").append(OneRec.gongzuoyaoqiu);
	
	//公司信息
	var gsxx=$("<span></span>").append("公司信息").addClass("label label-info");
	var gsxx1=$("<dt></dt>").append(gsxx);
	//名称
	var companyname=$("<span></span>").append("名称:  ");
	var company=$("<dt></dt>").append(companyname).append(OneRec.companyInfo.company);
	//地址
	var addr=$("<span></span>").append("地址：  ");
	var address=$("<dt></dt>").append(addr).append(OneRec.companyInfo.address);
	//电话
	var tele=$("<span></span>").append("电话：  ");
	var telephone=$("<dt></dt>").append(tele).append(OneRec.companyInfo.telephone);
	//官网
	var web=$("<span></span>").append("官网：  ");
	var website=$("<dt></dt>").append(web).append(OneRec.companyInfo.web);
	var dl=$("<dl></dl>")
	.append(zhaoinzhe)
	.append(zw)
	.append(sal)
	.append(xul)
	.append(jyg)
	.append(zwx)
	.append(gwy)
	.append(gongzuozhize)
	.append(gzyq)
	.append(gongzuoyaoqiu)
	.append(gsxx1)
	.append(company)
	.append(address)
	.append(telephone)
	.append(website)
	.appendTo("#onerec");
	
}
//手动关闭模态框
$("#gbbtn").click(function(){
	$("#myModal").modal('hide');
})
</script>
</body>
</html>